package com.gxjc.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gxjc.dao.bean.UserDao;
import com.gxjc.model.User;
@Service
public class UserService {
	@Autowired
	UserDao userDao;
	public List<User> getAll(){
		return userDao.getAll();	
	}
	@Transactional
	public void save(User user) {
		userDao.save(user);
	}
	
	public void delete(int id) {
		userDao.delete(id);
	}
	
	public User getUserById(int id) {
		return (User)userDao.getUserById(id);
	}
	public List<User> getUserBySql(String sql) {
		return userDao.getUserBySql(sql);
	}
	public void update(User user) {
		userDao.update(user);
	}
		
}
